package demo.ybt;

import java.util.Arrays;

public class P1319 {

    public static void main(String[] args) {
        P1319 p1319= new P1319();
        double pdjs = p1319.pdjs(new int[]{56, 12, 1, 99, 1000, 234, 33, 55, 99, 812});
        System.out.println(pdjs);
    }

    public double pdjs(int[] arr) {
        Arrays.sort(arr);
        int sum = 0;
        int sumTotall = 0;
        for (int i = 0; i < arr.length; i++) {
            if (i - 1 >= 0) {
                sum += arr[i - 1];
            }
            sumTotall+=sum;
        }

        return (double)sumTotall/arr.length;
    }
}
